package util

import "github.com/sony/sonyflake"

var sf *sonyflake.Sonyflake

func init() {
	var st sonyflake.Settings
	st.MachineID = func() (uint16, error) {
		return 2,nil
	}
	sf = sonyflake.NewSonyflake(st)

}

func GainId() uint64 {
	id,_:=sf.NextID()
	return id
}

func JcNumber(number string) string {
	if number=="0"{
		return ""
	}
	if len(number)==1{
		return "00"+number
	}
	if len(number)==2{
		return "0"+number
	}
	return number
}